from django.conf.urls.defaults import *
from django.views.decorators.cache import cache_page
from lbmanager.bigiplite.views import MemberStatusWidget

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

from django.conf import settings

urlpatterns = patterns('',
    # Example:
    (r'^lbswitch/$','lbmanager.bigiplite.views.index'),
    (r'^lbswitch/help/$','lbmanager.bigiplite.views.help'),
    (r'^lbswitch/enable/(?P<partition>\w+)/(?P<POOL>.+)/(?P<enable_members>.+)/(?P<disable_members>.+)/$','lbmanager.bigiplite.views.EnableMember'),

    (r'^lbswitch/status/(?P<partition>\w+)/(?P<POOL>.+)/$','lbmanager.bigiplite.views.MemberStatus'),
    (r'^lbswitch/statuswidget/(?P<partition>\w+)/(?P<POOL>.+)/$',cache_page(MemberStatusWidget, 60)),

	# pool index
    (r'^lbswitch/list/(?P<partition>\w+)/$','lbmanager.bigiplite.views.poolIndex'),

    (r'^lbswitch/setlb/(?P<loadbalancer>.+)/$', 'lbmanager.bigiplite.views.setLB'),
    (r'^lbswitch/setlb/(?P<loadbalancer>.+)$', 'lbmanager.bigiplite.views.setLB'),
	
    (r'^lbswitch/login$','lbmanager.bigiplite.views.login'),
    (r'^lbswitch/login/$','lbmanager.bigiplite.views.login'),

    (r'^lbswitch/logout/$','lbmanager.bigiplite.views.logout'),
    (r'^lbswitch/logout$','lbmanager.bigiplite.views.logout'),

    # Uncomment the next line to enable the admin:
    (r'^lbswitch/admin/', include(admin.site.urls)),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^lbmanager/media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.STATIC_DOC_ROOT}),
    )  
